import Koa from "koa"
import Router from "koa-router"
import index_routers from "./routers/index_routers.js"
import cors from "@koa/cors"
import bodyParser from "koa-bodyparser"
// import {sync} from "./db/init.js"

// sync()


const app = new Koa()
const router = new Router()

app.use(cors())
app.use(bodyParser())

router.use(index_routers.routes())

app.use(router.routes())




app.listen(8080,()=>{
    console.log("http://localhost:8080");
    
})